<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
    use HasFactory;
    protected $table = "tb_category";
    protected $primaryKey = "cate_id";
    public $incrementing = false;
    public $timestamps = false;
    protected $fillable = ["cate_name", "cate_parent", "cate_create_time", "cate_status", "cate_weight"];

    // the one to many
    public function children(){
        return $this->hasMany("App\Models\Category", "cate_parent", "cate_id");
    }
}
